package br.com.gaacorp.sai.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

@Entity
@Table(name = "tab_questionnaire")
public class Questionnaire extends BaseObject implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5442666524736423039L;
	private Long questionnaireId;
	private String title;
	private String description;

	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Questionnaire)) {
			return false;
		}

		final Questionnaire questionnaire = (Questionnaire) o;

		return !(title != null ? !title.equals(questionnaire.title)
				: questionnaire.title != null);
	}

	public String getDescription() {
		return description;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getQuestionnaireId() {
		return questionnaireId;
	}

	public String getTitle() {
		return title;
	}

	public int hashCode() {
		return (title != null ? title.hashCode() : 0);
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setQuestionnaireId(Long questionnaireId) {
		this.questionnaireId = questionnaireId;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append(
				this.title).toString();
	}

}
